package com.spring.aop.interceptor;

import com.spring.aop.Advisor;
import com.spring.aop.InterceptorChain;

import java.lang.reflect.Method;

/**
 * 拦截器对象  , 由 Advisor 通知对象 转化过来
 */

public abstract class Interceptor {
	// 保存切面对象
	protected Advisor advisor;
	
	public Interceptor(Advisor advisor) {
		this.advisor = advisor;
	}
	
	/**
	 * 拦截方法，根据不同的子类执行不同 before after 等等逻辑
	 */
	public abstract Object invoke(InterceptorChain chain, Object targetObject, Method targetMethod, Object[] args) throws Throwable;
}










